/**
 * Created by Tsuna Cheung on 2016/12/5.
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    TextInput,
} from 'react-native';
export default class EditView extends Component {
    constructor(props) {
        super(props);
        this.state = {text: ''};
    }

    render() {
        return (
            <TextInput style={[EditViewStyles.textInput, {flex: this.props.flexValue}]}
                       placeholder={this.props.name}
                       secureTextEntry={this.props.secure}
                       underlineColorAndroid="transparent"
                       onChangeText={(text) => {
                           this.setState({text});
                           this.props.onChangeText(text);
                       }}/>
        );
    }
}

const EditViewStyles = StyleSheet.create({
    textInput: {
        height: 37,
        backgroundColor: '#EFEFEF',
        marginRight: 40,
        borderRadius: 3
    },

});
